﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" type="text/css" href="Script/jquery-easyui-1.6.2/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="Script/jquery-easyui-1.6.2/themes/icon.css">
    <script src="Script/jquery-easyui-1.6.2/jquery.min.js"></script>
    <script src="Script/jquery-easyui-1.6.2/jquery.easyui.min.js"></script>
    <script src="Script/Layer/layer.min.js"></script><!--三个小黄点加载,其他是EasyUI加载-->
</head>
<body>
    <div><span style="color:red;">建议用jyDoAjaxCall</span></div>
    <script src="Script/Config.js"></script>
    <script src="AjaxJS.js"></script>
    <script>
         //jyDoAjaxCall
        var sync = jyDoAjaxCall(configJS.webApiAddress + "/api/Ajax/GetVal", "get", "json",   //同步：
            { name: "test1", age: "123" }
        );
        console.log(sync);
        jyDoAjaxCall(configJS.webApiAddress + "/api/Ajax/GetVal", "get", "json",    //异步：
            { NAME: "test2", AGE: "456" }
            , function (retObject) {
                console.log(retObject);
            });

        sync = jyDoAjaxCall(configJS.webApiAddress + "/api/Ajax/PostVal", "POST", "json",   //同步：
            { name: "陈浪", age: "18", sex: "男" }
        );
        console.log(sync);
        jyDoAjaxCall(configJS.webApiAddress + "/api/Ajax/PostVal", "POST", "json",    //异步：
            { name: "卢朗", age: "20", sex: "男" }
            , function (retObject) {
                console.log(retObject);
            });

        // jyDoAjaxCallByDefault
        //sync = jyDoAjaxCallByDefault(configJS.webApiAddress + "/api/Ajax/GetVal", "get", "json",   //同步：
        //    { name: "test1", age: "123" }
        //);
        //console.log(sync);
        //jyDoAjaxCallByDefault(configJS.webApiAddress + "/api/Ajax/GetVal", "get", "json",    //异步：
        //    { NAME: "test2", AGE: "456" }
        //    , function (retObject) {
        //        console.log(retObject);
        //    });

        //sync = jyDoAjaxCallByDefault(configJS.webApiAddress + "/api/Ajax/PostVal", "POST", "json",   //同步：
        //    { name: "陈浪", age: "18", sex: "男" }
        //);
        //console.log(sync);
        //jyDoAjaxCallByDefault(configJS.webApiAddress + "/api/Ajax/PostVal", "POST", "json",    //异步：
        //    { name: "卢朗", age: "20", sex: "男" }
        //    , function (retObject) {
        //        console.log(retObject);
        //    });
    </script>
</body>
</html>